home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cgraphix / dblint.c < prev    next >
Text File  |  1986-05-27  |  369b  |  20 lines

  1. /* «RM120»«PL99999»«TS4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76» */
  2. /* double to integer conversion with bound limits imposed                    */
  3. #include    <stdio.h>
  4.  
  5. #define    MAXINT    32767
  6. #define    MININT    -32768
  7.  
  8. int dblint(dbl)
  9. double    dbl;
  10. {
  11.     if (dbl > MAXINT)
  12.         return(MAXINT);
  13.     else if (dbl < MININT)
  14.         return(MININT);
  15.     else
  16.         return((int)dbl);
  17. }
  18.  
  19.  
  20.